package com.wanxi.StringAppend;

public class MyAppend {
    public static void main(String[] args) {
        int[] arr = {11, 22, 245, 3, 4, 5, 6};
        String str = append(arr);
        System.out.println(str);
    }

    private static String append(int[] arr) {
        String str = "[";
        for (int i = 0; i < arr.length; i++) {
            str += arr[i];
//            str = str + arr[i];
            if (i != arr.length - 1) {

//            } else {
                str += ", ";
            }
        }
        str += "]";
        return str;
    }
}
